﻿using Furion;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using System.Threading;

namespace Queer.AutoJob
{
    [AppStartup(1)]
    public class JobAppStartup : AppStartup
    {
        public void ConfigureServices(IServiceCollection services)
        {

        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            // 定时任务， 这里采用多线程去执行，减少初次启动时间
            Thread thread = new Thread(() =>
            {
                // 挂起60秒
                Thread.Sleep(60 * 1000);
                JobCenter.Start();
            });

            thread.Start();
        }

    }
}